//
//  UIView+Extension.m
//  Baisijie
//
//  Created by 王建伟 on 2017/3/2.
//  Copyright © 2017年 RangGuangyu. All rights reserved.
//

#import "UIView+Extension.h"

@implementation UIView (Extension)

- (void)setBs_width:(CGFloat)bs_width {
    CGRect frame = self.frame;
    frame.size.width = bs_width;
    self.frame = frame;
}
- (CGFloat)bs_width {
    return self.bounds.size.width;
}
- (void)setBs_height:(CGFloat)bs_height {
    CGRect frame = self.frame;
    frame.size.height = bs_height;
    self.frame = frame;
}
- (CGFloat)bs_height {
    return self.bounds.size.height;
}
- (void)setBs_x:(CGFloat)bs_x {
    CGRect frame = self.frame;
    frame.origin.x = bs_x;
    self.frame = frame;
}
- (CGFloat)bs_x {
    return self.bounds.origin.x;
}
- (void)setBs_y:(CGFloat)bs_y {
    CGRect frame = self.frame;
    frame.origin.y = bs_y;
    self.frame = frame;
}
- (CGFloat)bs_y {
    return self.bounds.origin.y;
}
- (void)setBs_centerX:(CGFloat)bs_centerX {
    CGPoint center = self.center;
    center.x = bs_centerX;
    self.center = center;
}
- (CGFloat)bs_centerX {
    return self.center.x;
}
- (void)setBs_centerY:(CGFloat)bs_centerY {
    CGPoint center = self.center;
    center.y = bs_centerY;
    self.center = center;
}
- (CGFloat)bs_centerY {
    return self.center.y;
}
- (void)setBs_size:(CGSize)bs_size {
    CGRect frame = self.frame;
    frame.size = bs_size;
    self.frame = frame;
}
- (CGSize)bs_size {
    return self.bounds.size;
}
+ (instancetype)bs_viewFromNib {
    return [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil].firstObject;
}

@end
